﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="AddEstate.aspx.cs" Inherits="AddEstate" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <ext:Store runat="server" ID="CitiesStore" AutoLoad="false" OnRefreshData="CitiesRefresh">
        <DirectEventConfig>
            <EventMask ShowMask="false" />
        </DirectEventConfig>
        <Reader>
            <ext:JsonReader IDProperty="Id">
                <Fields>
                    <ext:RecordField Name="id" Type="String" Mapping="Id" />
                    <ext:RecordField Name="name" Type="String" Mapping="Name" />
                </Fields>
            </ext:JsonReader>
        </Reader>
        <Listeners>
            <Load Handler="#{Cities}.setValue(#{Cities}.store.getAt(0).get('name'));" />
        </Listeners>
    </ext:Store>
    <ext:Panel ID="Panel1" runat="server" Title="Add Estate" PaddingSummary="5px 5px 0"
        Width="790px" Frame="true" ButtonAlign="Center" Layout="Form">
        <Items>
            <ext:DropDownField ID="Field1" runat="server" TriggerIcon="SimpleArrowDown" FieldLabel="Type">
                <%--bu dropdownlist veritabanı sorgusuyla doldurulsa daha iyi olabilir.--%>
                <Component>
                    <ext:Panel ID="Panel2" runat="server" Height="220" Layout="Accordion">
                        <Items>
                            <ext:MenuPanel ID="MenuPanel1" runat="server" Title="House" Icon="House">
                                <Menu ID="Menu1" runat="server">
                                    <Items>
                                        <ext:MenuItem ID="MenuItem1" runat="server" Text="Daire" />
                                        <ext:MenuItem ID="MenuItem2" runat="server" Text="Yazlık" />
                                        <ext:MenuItem ID="MenuItem3" runat="server" Text="Residance" />
                                        <ext:MenuItem ID="MenuItem4" runat="server" Text="Devremülk" />
                                        <ext:MenuItem ID="MenuItem5" runat="server" Text="Müstakil Ev" />
                                        <ext:MenuItem ID="MenuItem6" runat="server" Text="Prefabrik Ev" />
                                    </Items>
                                    <Listeners>
                                        <ItemClick Handler="#{Field1}.setValue('House - '+menuItem.text);" />
                                    </Listeners>
                                </Menu>
                            </ext:MenuPanel>
                            <ext:MenuPanel ID="MenuPanel2" runat="server" Title="Workplace" Icon="Building">
                                <Menu ID="Menu2" runat="server">
                                    <Items>
                                        <ext:MenuItem ID="MenuItem7" runat="server" Text="Dükkan & Mağaza" />
                                        <ext:MenuItem ID="MenuItem8" runat="server" Text="Büro & Ofis" />
                                        <ext:MenuItem ID="MenuItem9" runat="server" Text="Depo" />
                                        <ext:MenuItem ID="MenuItem10" runat="server" Text="Fabrika" />
                                        <ext:MenuItem ID="MenuItem11" runat="server" Text="Komple Bina" />
                                        <ext:MenuItem ID="MenuItem12" runat="server" Text="Restorant & Lokanta" />
                                        <ext:MenuItem ID="MenuItem13" runat="server" Text="Market" />
                                    </Items>
                                    <Listeners>
                                        <ItemClick Handler="#{Field1}.setValue('Building - '+menuItem.text);" />
                                    </Listeners>
                                </Menu>
                            </ext:MenuPanel>
                            <ext:MenuPanel ID="MenuPanel3" runat="server" Title="Plot" Icon="Map">
                                <Menu ID="Menu3" runat="server">
                                    <Items>
                                        <ext:MenuItem ID="MenuItem14" runat="server" Text="Çiftlik" />
                                        <ext:MenuItem ID="MenuItem15" runat="server" Text="Maden Ocağı" />
                                        <ext:MenuItem ID="MenuItem16" runat="server" Text="Depo & Antrepo" />
                                        <ext:MenuItem ID="MenuItem17" runat="server" Text="Otopark" />
                                        <ext:MenuItem ID="MenuItem18" runat="server" Text="Sulama" />
                                    </Items>
                                    <Listeners>
                                        <ItemClick Handler="#{Field1}.setValue('Map - '+menuItem.text);" />
                                    </Listeners>
                                </Menu>
                            </ext:MenuPanel>
                        </Items>
                    </ext:Panel>
                </Component>
            </ext:DropDownField>
            <ext:TextField ID="title" runat="server" FieldLabel="Title of Ann." AnchorHorizontal="100%" />
            <ext:TextField ID="room" runat="server" FieldLabel="Room Count" AllowBlank="false"
                AnchorHorizontal="100%" />
            <ext:CompositeField ID="CompositeField1" runat="server" FieldLabel="Price" AnchorHorizontal="100%">
                <Items>
                    <ext:TextField ID="price" runat="server" Width="75" />
                </Items>
            </ext:CompositeField>
            <%--------------------%>
            <ext:ComboBox ID="Countries" runat="server" Editable="false" TypeAhead="true" Mode="Local"
                ForceSelection="true" TriggerAction="All" SelectOnFocus="true" EmptyText="Select a country">
                <Listeners>
                    <Select Handler="#{Cities}.clearValue(); #{CitiesStore}.reload();" />
                </Listeners>
                <Items>
                    <ext:ListItem Text="Belgium" Value="BE" />
                    <ext:ListItem Text="Brazil" Value="BR" />
                    <ext:ListItem Text="Bulgaria" Value="BG" />
                    <ext:ListItem Text="Canada" Value="CA" />
                    <ext:ListItem Text="Chile" Value="CL" />
                    <ext:ListItem Text="Cyprus" Value="CY" />
                    <ext:ListItem Text="Finland" Value="FI" />
                    <ext:ListItem Text="France" Value="FR" />
                    <ext:ListItem Text="Germany" Value="DE" />
                    <ext:ListItem Text="Hungary" Value="HU" />
                    <ext:ListItem Text="Ireland" Value="IE" />
                    <ext:ListItem Text="Israel" Value="IL" />
                    <ext:ListItem Text="Italy" Value="IT" />
                    <ext:ListItem Text="Lithuania" Value="LT" />
                    <ext:ListItem Text="Mexico" Value="MX" />
                    <ext:ListItem Text="Netherlands" Value="NL" />
                    <ext:ListItem Text="New Zealand" Value="NZ" />
                    <ext:ListItem Text="Norway" Value="NO" />
                    <ext:ListItem Text="Pakistan" Value="PK" />
                    <ext:ListItem Text="Poland" Value="PL" />
                    <ext:ListItem Text="Romania" Value="RO" />
                    <ext:ListItem Text="Slovakia" Value="SK" />
                    <ext:ListItem Text="Slovenia" Value="SI" />
                    <ext:ListItem Text="Spain" Value="ES" />
                    <ext:ListItem Text="Sweden" Value="SE" />
                    <ext:ListItem Text="Switzerland" Value="CH" />
                    <ext:ListItem Text="United Kingdom" Value="GB" />
                </Items>
            </ext:ComboBox>
            <ext:ComboBox ID="Cities" runat="server" StoreID="CitiesStore" TypeAhead="true" Mode="Local"
                ForceSelection="true" TriggerAction="All" DisplayField="name" ValueField="name"
                EmptyText="Loading..." ValueNotFoundText="Loading...">
            </ext:ComboBox>
            <%--------------------%>
            <ext:CompositeField ID="CompositeField3" runat="server" FieldLabel="m2" AnchorHorizontal="100%">
                <Items>
                    <ext:TextField ID="m2" runat="server" Width="50" />
                </Items>
            </ext:CompositeField>
            <ext:TextArea ID="descrip" runat="server" FieldLabel="Description" AnchorHorizontal="100%" />
            <ext:FileUploadField FieldLabel="Picture" ID="FileUploadField1" runat="server" Text="Upload a Picture...">
            </ext:FileUploadField>
            <ext:DropDownField ID="DropDownField1" runat="server" TriggerIcon="SimpleArrowDown"
                FieldLabel="Case">
                <%--bu dropdownlist veritabanı sorgusuyla doldurulsa daha iyi olabilir.--%>
                <Component>
                    <ext:MenuPanel ID="MenuPanel6" runat="server" Title="Case" Icon="Money">
                        <Menu ID="Menu6" runat="server">
                            <Items>
                                <ext:MenuItem ID="MenuItem32" runat="server" Text="Satılık" />
                                <ext:MenuItem ID="MenuItem33" runat="server" Text="Kiralık" />
                            </Items>
                            <Listeners>
                                <ItemClick Handler="#{DropDownField1}.setValue(menuItem.text);" />
                            </Listeners>
                        </Menu>
                    </ext:MenuPanel>
                </Component>
            </ext:DropDownField>
        </Items>
        <Buttons>
            <ext:Button ID="Button1" runat="server" Text="Save">
                <Listeners>
                    <Click Handler="Ext.net.DirectMethods.addEstate();" />
                </Listeners>
            </ext:Button>
            <ext:Button ID="Button2" runat="server" Text="Cancel" />
        </Buttons>
        <Content>
            <ext:Label runat="server" ID="gorkem"></ext:Label>
        </Content>
    </ext:Panel>
    
</asp:Content>
